function loadEpisode(id){
  $('[data-episode-id = ' + id + ']').click();// find and open the episode
  
  var url = $(".audioPlayerTag").last().attr('src');//get the url for the episode
  var title = $('.modal-body h3').last().text();//get the title for the episode
  var sum = $('.modal-body p').last().text(); //get the summary
  var img = $('.modal-body img').last().attr('src'); //get the summary
  $('a.close.closeOverlay').last().click(); //close the overlay
  console.log(title + "\t" + sum + "\t" + img + "\t" + url);
  
}

$('.playEpisode').each(function(index, element){
loadEpisode($(this).attr('data-episode-id'))
});